package com.prg.util;

import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-10-26
 * Time: 下午1:20
 * To change this template use File | Settings | File Templates.
 */


public class ExportToDB {

    public ExportToDB(){
        // 读取配置文件
        Configuration cfg = new Configuration().configure();
        // 创建SchemaExport对象
        SchemaExport export = new SchemaExport(cfg);
        // 创建数据库表
        export.create(true, true);
    }

}
